<script setup>
import { ref } from 'vue';

import { useRouter } from 'vue-router';
const router = useRouter();
defineProps({
  introduce: Object,
  index: Number,
  readMore: Boolean
});
const goToDetail = (id) => {
  router.push({ path: '/classDeatilPc', query: { id } });
};

const count = ref(0);
</script>

<template>
<div class="introduceProject"  @click="goToDetail(introduce.id)">
    <div class="introduceProject-top">
        <img :src=introduce.coverimage />
        <span class="introduceProject-top-tip"><div class="btn">精选推荐</div></span>
    </div>
    <div class="introduceProject-title">{{introduce.titile}}</div>
     <div class="introduceProject-subtitle">{{introduce.subtitle}}</div>
      <div class="introduceProject-wrap">
        <div v-if="readMore" class="look-more">
            查看详情
        </div>
        <span v-else class="introduceProject-wrap-left">
            <span>{{introduce.reads}}</span>
            人咨询
        </span>
         <span class="introduceProject-wrap-right">
            ¥
            <span>{{introduce.price}}</span>
        </span>
      </div>
</div>
</template>

<style scoped lang="less">
.introduceProject {
    margin-bottom: 20Px;
    width: 361Px;
    background: #FFFFFF;
    border-radius: 14Px;
    cursor: pointer;
    .introduceProject-top{
        position: relative;
        width: 361Px;
        height: 258Px;
        margin-bottom: 21Px;
        border-radius: 13Px 13Px 0 0;
        img {
            width: 100%;
            height: 100%;
            border-radius:14Px 14Px 0Px 0Px;
        }
        .introduceProject-top-tip {
            position: absolute;
            left: 0;
            bottom: 0;
            width: 361Px;
            height: 62Px;
            background: rgba(255,255,255,0.46);
            border-radius: 33Px 33Px 0Px 0Px;
            border: 1Px solid #FFFFFF;
            backdrop-filter: blur(6.656000000000001Px);
            display: flex;
            align-items: center;
            justify-content: center;
            .btn {
                width: 116Px;
                height: 40Px;
                background-image: url('../../assets/pc/homepage-btn.png');
                background-size: 100%;
                font-size: 15Px;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #ffffff;
                line-height: 21Px;
                line-height: 40Px;
                padding-left: 15Px;
                }
        }
    }
    .introduceProject-title {
        font-size: 25Px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #000000;
        line-height: 34Px;
        margin-bottom: 2Px;
        padding: 0 6Px;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }
    .introduceProject-subtitle {
        font-size: 17Px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #111111;
        line-height: 22Px;
        margin-bottom: 12Px;
        padding: 0 6Px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .introduceProject-wrap {
        padding: 0 6Px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .look-more {
            width: 85Px;
            height: 27Px;
            border-radius: 16Px;
            border: 1Px solid #C5B6FD;
            font-size: 13Px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #000000;
            line-height: 27Px;
            text-align: center;
        }
        .introduceProject-wrap-left {
            font-size: 14Px;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #999999;
            line-height: 20Px;  
            display: flex;
            align-items: center;
            span {
                font-size: 21Px;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #999999;
                line-height: 29Px;
                // max-width: 50Px;
                display: inline-block;
                overflow: hidden;
                text-overflow:ellipsis;
                white-space: nowrap;
            }
        }
        .introduceProject-wrap-right {
            color: #FF544D;
            font-size: 16Px;
            span {
                font-size: 21Px;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #FF544D;
                line-height: 29Px;
            }
        }
    }
}

</style>
